<template>
<div class='g-content-wrapper'>
  <header-top>大单资金</header-top>
  <div class="g-content">
    <state></state>
    <tab-bar :tabBar="menuTabBar" :on-selected="onBarSelected"></tab-bar>
    <div v-if = "msgBar == 0">
      <chart-connect :chart-data = "chartConnectData"></chart-connect>
      <div class="interval"></div>
      <detail-list :list-type="listType" :list-data="listData" :head-content = 'headContent' :updateTime="listUpdateTime">大单资金流入标的</detail-list>
    </div>
    <chart-overlap v-else :chart-data = "chartOverlapData"></chart-overlap>
    <div class="interval"></div>
    <div class='comment'>
    <h1 class='comment-title'>大单资金</h1>
      <p>以沪深两市所有股票为统计对象，根据股价、占流通盘比例、成交数量来确定大单的范围，统计所有大单的资金流入流出情况。<br/>大单资金能够反应大户的动向，在一定程度上推动股价涨跌。</p>
    </div>
  </div>
</div>
</template>

<script>
import headerTop from '@/pages/common/HeaderTop'
import state from '@/pages/common/State'
import tabBar from '@/pages/common/TabBar'
import chartConnect from '@/pages/common/ChartConnect'
import chartOverlap from '@/pages/common/ChartOverlap'
import detailList from '@/pages/common/DetailList'
// import remoteDAO from '@/common//remoteDAO'
// import constant from '@/common/constant'
// import tools from 'libs/common/tools'
// import { transform1013 } from '@/common/common'
// import { Loop } from '@/common/polling'

// const timeFromMinuts = m => {
//   let h = m / 60;
//   h = h > 10 ? h : '0' + h;
//   let min = m % 60;
//   min = min > 10 ? min : '0' + min;
//   return `${h}:${min}`
// };
// 当日大单联动图表数据
// const chartConnectData = data => {
//   let xTime = [],
//     netNumber = [],
//     mIn = [],
//     mOut = [],
//     mNetNumber = [];
//   data.TableInfo.forEach(item => {
//     xTime.push(timeFormMinuts(item.minute));
//     netNumber.push(item.ljjlr);
//     mIn.push(item.bbmoney);
//     mOut.push(item.sbmoney);
//     mNetNumber.push(item.ddjlr)
//   });
//   return {
//     xTime: xTime,
//     netNumber: netNumber,
//     minute: {
//       in: mIn,
//       out: mOut,
//       mNetNumber: mNetNumber
//     }
//   }
// }

// 近一月、近三月图表数据
// const chartOverlapData = data => {
// let xTime = [],
//   netNumber = [],
//   mIn = [],
//   mOut = [],
//   mNetNumber = [];
// data.TableInfo.forEach(item => {
//   xTime.push(timeFormMinuts(item.minute));
//   netNumber.push(item.ljjlr);
//   mIn.push(item.bbmoney);
//   mOut.push(item.sbmoney);
//   mNetNumber.push(item.ddjlr)
// });
// return {
//   xTime: xTime,
//   netNumber: netNumber,
//   minute: {
//     in: mIn,
//     out: mOut,
//     mNetNumber: mNetNumber
//   }
// }
// }
export default {
  name: 'large-order',
  data () {
    return {
      menuTabBar: [{name: '今日'}, {name: '近一月'}, {name: '近三月'}],
      msgBar: 0,
      listUpdateTime: '',
      listType: 'c',
      listData: [],
      headContent: ['流入标的', '现价', '净流入'],
      chartConnectData: {},
      chartData: [],
      chartOverlapData: null,
      topDesc: ''
    }
  },
  components: {
    headerTop,
    state,
    tabBar,
    chartConnect,
    chartOverlap,
    detailList
  },
  methods: {
  },
  created() {
    // this.fetchTopDesc();
  },
  mounted () {
    // Loop.getInstance().register(this.fetchData, this.fetchStkData);
  }
}
</script>

<style lang="less" scoped>
  @import '../../assets/css/common.less';
  @import '../../assets/css/cssReset';
</style>
